//
// Created by wze-zero on 2024/10/21.
//
#include <iostream>

using namespace std;

bool check(int num) {
    if (num == 1 || num == 2) {
        return true;
    } else {
        for (int i = 2; i < num / 2; ++i) {
            if (num % i == 0) {
                return false;
            }
        }
        return true;
    }
}

int main() {
    int n, num;
    cin >> n;
    for (int i = 0; i < n; ++i) {
        cin >> num;
        check(num) ? cout << "true" << endl : cout << "false" << endl;
    }
    return 0;
}